const connections = require('../app/database')
class FileService {
  async createAvatar(filename, mimetype, size, userId) {
    try {
      const res = await connections.execute('INSERT INTO `avatar`(filename, mimetype, size, userId) VALUES (?, ?, ?, ?)', [filename, mimetype, size, userId])
      return res[0]
    } catch (error) {
      console.log(error);
    }
  }
}

module.exports = new FileService()